<?php

/**
 * 内容详情
 */

namespace app\page\api;

use \app\base\api\BaseApi;

class InfoApi extends BaseApi {

    public function index() {
        $label = $this->data['label'];
        $pageInfo = target('page/Page')->getWhereInfo([
            'B.label' => $label
        ]);
        if (empty($pageInfo)) {
            $this->error404();
        }
        $pageInfo['content'] = html_out($pageInfo['content']);
        $this->success('ok', $pageInfo);
    }

}